import http from '@/utils/httpRequest'
export default {

	/** 查询所有商品分类    **/
  getCategory (param) {
    return http.get(http.adornUrl('admin/category/all'), {
      params: param
    })
  },
	/** 查询商品分组所有数据    **/
  getGoodsGroup (param) {
    return http.get(http.adornUrl('admin/goods_group/all'), {
      params: param
    })
  },
	/** 查询商品一级分组数据    **/
  getGoodsGroupFirst () {
    return http.get(http.adornUrl('admin/goods_group/first'))
  },
	/** 查商家所有商品规格    **/
  getSkuAll () {
    return http.get(http.adornUrl('admin/skus/all'))
  },
	/** 商品列表    **/
  getGoodsList (param) {
    return http.get(http.adornUrl('admin/goods/self/pages'), {
      params: param
    })
  },
	/** 商品列表上下架    **/
  goodsPutAway (param) {
    return http.put(http.adornUrl('admin/goods/added'), param)
  },

	/** 查商家所有一级规格    **/
  getSkuTop () {
    return http.get(http.adornUrl('admin/skus/top'))
  },
	/** 商家评论列表    **/
  getCommentList (param) {
    return http.get(http.adornUrl('admin/comment/orderGoods/list'), {
      params: param
    })
  },
	/** 评论(删除)   **/
  delcommontCard (param) {
    return http.delete(http.adornUrl('admin/comment/orderGoods/delete/' + param))
  },
	/** 评论显示隐藏   **/
  commotPutAway (param) {
    return http.post(http.adornUrl('admin/comment/orderGoods/show'), param)
  },
	/** 查看商家规格属性    **/
  getSkuInfo (param) {
    return http.get(http.adornUrl('admin/skus/info/' + param))
  },
	/** 获取运费模板    **/
  freighttemplate () {
    return http.get(http.adornUrl('admin/freighttemplate/list-slim'))
  },
	/** 获取运费模板    **/
  goodsInfo (param) {
    return http.get(http.adornUrl('admin/goods/info/' + param))
  },
	/** 添加商品规格**/
  createSku (param) {
    return http.post(http.adornUrl('admin/skus/create'), param)
  },
	/** 修改商品规格**/
  updateSku (param) {
    return http.put(http.adornUrl('admin/skus/update'), param)
  },
	/** 获取sku二级**/
  selectSku (param) {
    return http.post(http.adornUrl('admin/skus/select'), param)
  },
	/** 发布商品**/
  goodsCreate (param) {
    return http.post(http.adornUrl('admin/goods/create'), param)
  },
	/** 修改商品**/
  goodsUpdate (param) {
    return http.put(http.adornUrl('admin/goods/update'), param)
  },
	/** 删除商家规格属性  **/
  delSku (param) {
    return http.delete(http.adornUrl('admin/skus/delete/' + param))
  },
	/** 得到新手和公告的列表  **/
  saveBanners2 (param) {
    return http.put(http.adornUrl('bannertext/save'), param)
  },

	/**
	 * 商家后台删除商品
	 * */
  businessDelgoods (id) {
    return http.delete(http.adornUrl(`admin/goods/delete/${id}`))
  },

	/**
	 * 商家设置商品是否开启会员折扣
	 * */
  openDiscount (param) {
    return http.put(http.adornUrl('admin/goods/open-user-discount'), param)
  },

	/**
	 * 查询平台分销设置
	 * */
  searchDistributionconfig () {
    return http.get(http.adornUrl('admin/distributionconfig/info'))
  },

	/**
	 * 保存平台分销设置
	 * */
  setDistributionconfig (param) {
    return http.post(http.adornUrl('admin/distributionconfig/set'), param)
  },

	/**
	 * 获取自营商品统一分销设置
	 * */
  getGoodsSalesConfig () {
    return http.get(http.adornUrl('admin/distributionshopconfig/info'))
  },

	/**
	 * 设置自营商品统一分销设置
	 * */
  setGoodsSalesConfig (param) {
    return http.post(http.adornUrl('admin/distributionshopconfig/set'), param)
  },

	/**
	 * 查询平台商家代销商品小程序分佣配置
	 * */
  getShopproxyconfig () {
    return http.get(http.adornUrl('admin/shopproxyconfig/info'))
  },

	/**
	 * 保存平台商家代销商品小程序分佣配置
	 * */
  setShopproxyconfig (param) {
    return http.post(http.adornUrl('admin/shopproxyconfig/set'), param)
  },
  shareSave (param) {
    return http.put(http.adornUrl('admin/config/share/save'), param)
  },
  getShare () {
    return http.get(http.adornUrl('admin/config/share/load'))
  },
	/*
	商家或平台,分页查询会员分佣所得
	 **/
  getUserordergainsList (param) {
    return http.get(http.adornUrl('admin/userordergains/pages'), {
      params: param
    })
  },
	/**
	 * 平台商家手动结算282，6750，差价分佣
	 * */
  settle (param) {
    return http.post(http.adornUrl('admin/userordergains/settlement'), param)
  },
	 /** 获取商家信息  **/
	 getShopInfoAdmin () {
   return http.get(http.adornUrl('/admin/yxt/shop/getShop'))
 },
  /** 新增服务**/
  createServicegoods (param) {
  	return http.post(http.adornUrl('admin/servicegoods/create'), param)
  },
  /** 编辑服务**/
  updateServicegoods (param) {
  	return http.put(http.adornUrl('admin/servicegoods/update'), param)
  },
  /** 删除服务商品  **/
  delServiceGoods (param) {
  	return http.delete(http.adornUrl('admin/servicegoods/delete/' + param))
  },
  /** 商家根据id查看服务商品    **/
  serviceGoodsInfo (param) {
  	return http.get(http.adornUrl('admin/servicegoods/info/' + param))
  },
  /** 服务列表上下架    **/
  servicePutAway (param) {
  	return http.put(http.adornUrl('admin/servicegoods/added'), param)
  },
  /** 平台根据id查看服务商品    **/
  getPlatformServiceInfo (param) {
  	return http.get(http.adornUrl('admin/servicegoods/get/' + param))
  }
}
